/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBox;

/**
 *
 * @author Julio Dantas
 */
public class EventoCheckBox implements ActionListener
//public class EventoCheckBox implements ItemListener
{

  private CanvasSOM canvasSOM;
  private int id;
  JCheckBox checkbox;

  public EventoCheckBox(CanvasSOM canvasSOM, int id, JCheckBox checkbox)
  {
    this.canvasSOM = canvasSOM;
    this.id = id;
    this.checkbox = checkbox;
  }
  
  public void actionPerformed(ActionEvent e)
  {
    //System.out.println("evento de clique");
    canvasSOM.setDesenhaClasses(checkbox.isSelected(), id);
    canvasSOM.repaint();
    //throw new UnsupportedOperationException("Not supported yet.");
  }

  /*public void itemStateChanged(ItemEvent e)
  {
    canvasSOM.setDesenhaClasses(!canvasSOM.getDesenhaClasses(id), id);
  }*/

  
}
